package com.example.hotelsystem.controller;

import code.CodeError;
import com.example.hotelsystem.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@Api(tags = "Shiro无权限调用控制器")
public class ErrorController {
    @ApiOperation("无权限跳转接口")
    @RequestMapping("/unauthorized")
    public Result Error(){
        return Result.error(CodeError.NO_PERMISSION,"你没有权限",null);
    }

    @ApiOperation("无权限跳转接口")
    @RequestMapping("/unlogin")
    public Result UnLogin(){
        return Result.error(CodeError.NOT_LOGIN,"请先登录",null);
    }
}
